<!DOCTYPE html>
<html lang="en">
<head>
    <title>梦彩文件转换</title>
    <!-- Import style -->
    <link rel="stylesheet" type="text/css" href="/element-plus.css">
    <!-- Import Vue 3 -->
    <script src="/vue.global.js"></script>
    <!-- Import component library -->
    <script src="/element-plus.js"></script>
</head>
<body>

<div id="app" style="display: flex;justify-content: center; margin: 30px">
    <el-upload drag action="/upload" :on-success="downloadFile"
               :accept="'application/zip,application/x-zip-compressed'">
        <el-icon class="el-icon--upload">
            <upload-filled/>
        </el-icon>
        <div class="el-upload__text">
            拖动文件到这里 或者 <em>点击上传</em>
        </div>
        <template #tip>
            <div class="el-upload__tip">请上传zip文件</div>
        </template>
    </el-upload>
</div>
</body>
<script>
    const App = {
        data() {
            return {
                message: "提交",
            };
        },
        methods: {
            downloadFile(req) {
                window.location.href = "/download?path=" + req
            }
        }
    };
    const app = Vue.createApp(App);
    app.use(ElementPlus);
    app.mount("#app");
</script>
<style>
    body {
    }

    button {

    }
</style>
</html>
